package collector.data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

public class StockList implements Iterable<Stock> {
	private String name;
	private HashMap<String,Stock> stocks;
	public StockList(String name) {
		this.name = name;
		this.stocks = new HashMap<String, Stock>();
	}
	
	public void addStock(Stock stock) {
		stocks.put(stock.getName(), stock);
	}
	
	public ArrayList<Stock> findStock(String mixed) {
		return new ArrayList<Stock>();
	}
	
	public Stock getStock(StockIdentifier identifier) {
		return stocks.get(identifier);
	}

	public String getName() {
		return this.name;
	}

	public String getIdentifier() {
		return this.name;
	}

	public int size() {
		return stocks.size();
	}

	@Override
	public Iterator<Stock> iterator() {
		return stocks.values().iterator();
	}
}
